from django.urls import path

from . import views


# app_name = 'user'


urlpatterns = [
    path("", views.SquareView, name="index"),
    path('search/', views.SquareView, name='search_users'),
    path("login/", views.loginView, name="login"),
    path("logout/", views.logoutView, name="logout"),
    path("centre/<slug:usrname>/", views.centreView, name="centre"),
    path("register/", views.registerView, name="register"),
    path('search/<slug:usrname>/', views.searchView, name='search_results'),
    path('follow/<slug:usrname>/', views.follow_usr, name='follow'),
    path('<slug:usrname>/followers/', views.FollowersListView.as_view(), name='followers_list'),  # follower fans
    path('<slug:usrname>/following/', views.FollowingListView.as_view(), name='following_list'),  # following
    # A follower is someone who follows you & a following is someone you follow.
    path('centre/<slug:usrname>/edit/', views.edit_user_info, name='edit_user_info'),
    # 用于注册时发送邮件验证码
    path('send_email_code/', views.sendEmailCodeView, name='send_email_code'),
    # 用于忘记密码时发送邮件验证码
    path('forget_pwd_send_email_code/', views.ForgetPwdSendEmailCodeView, name='forget_pwd_send_email_code'),
    path('forget_password/', views.ForgetPasswordView, name="forget_password")
]